package com.qiangesoft.blog.controller.manage;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qiangesoft.blog.common.annotation.OperationLog;
import com.qiangesoft.blog.common.mvc.PageQuery;
import com.qiangesoft.blog.common.mvc.PageResultVO;
import com.qiangesoft.blog.system.entity.SysExceptionLog;
import com.qiangesoft.blog.system.service.ISysExceptionLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 异常日志 前端控制器
 * </p>
 *
 * @author qiange
 */
@RestController
@RequestMapping("/system/exceptionLog")
@RequiredArgsConstructor
@Api(tags = "异常日志管理")
public class SysExceptionLogController {

    private final ISysExceptionLogService exceptionLogService;

    @GetMapping(value = "/list")
    @ApiOperation(value = "异常日志列表")
    public PageResultVO<SysExceptionLog> list(@Validated PageQuery pageQuery, String operation) {
        return exceptionLogService.listExceptionLog(pageQuery, operation);
    }

    @DeleteMapping(value = "/delete")
    @OperationLog(value = "删除异常日志")
    @ApiOperation(value = "删除异常日志")
    public void deleteBatch(@RequestBody List<Long> ids) {
        exceptionLogService.deleteBatch(ids);
    }
}

